<?php
/* @var $this StrukturOrganisasiController */
/* @var $model StrukturOrganisasi */

$this->breadcrumbs=array(
	'Struktur Organisasi'
);
?>

<div id="struktur-organisasi-grid" class="grid-view">
    <div class="x-panel-header-default x-horizontal x-panel-header-horizontal x-panel-header-default-horizontal x-top x-panel-header-top x-panel-header-default-top x-docked-top x-panel-header-docked-top x-panel-header-default-docked-top x-unselectable" style="height:17px;border:0px;">                    
        <span class="x-panel-header-text x-panel-header-text-default"></span>
    </div>
    <div class="ax-body-panel">
        <div class="summary">Total <?php echo count($data)?> results.</div>
        <div class="btn-right">
            <input class="ax-btn" type="button" onclick="window.location='/index.php?r=strukturOrganisasi/create'" name="yt0" value="Create New" /></div><div style="clear: both;">
        </div>
        <table class="items">
            <thead>
                <tr>
                    <th id="struktur-organisasi-grid_c1">
                        <a class="sort-link" href="#">
                            Nama
                        </a>
                    </th>
                    <th id="struktur-organisasi-grid_c1">
                        <a class="sort-link" href="#">
                            Tahun
                        </a>
                    </th>
                    <th id="struktur-organisasi-grid_c1">
                        <a class="sort-link" href="#">
                            Total Jabatan
                        </a>
                    </th>
                    <th class="lastcolumn" id="struktur-organisasi-grid_c2">&nbsp;</th>
                </tr>
            </thead>
            <tbody>
                <?php
                    foreach($data as $key=>$value){
                        if($value % 2 == 0){
                            $class = "odd";
                        }else{
                            $class = "even";
                        }
                            
                ?>
                <tr class="<?php echo $class?>">
                    <td><?php echo $value['nama']; ?></td>
                    <td><?php echo $value['tahun']; ?></td>
                    <td style="text-align:center">
                        <?php echo CHtml::link(
                                        $value['jumlah_jabatan'], 
                                        array(
                                            'Jabatan/index',
                                            'id_struktur_organisasi'=>$key
                                            )
                                        
                                ); 
                        ?>
                    </td>
                    <td class="lastcolumn">
                        <a class="update" title="Up" href="/strukturOrganisasi/up/<?php echo $key?>">
                            <img src="/images/icon/up.gif" alt="Up" />
                        </a>
                        <a class="update" title="Down" href="/strukturOrganisasi/down/<?php echo $key?>">
                            <img src="/images/icon/down.gif" alt="Down"/>
                        </a>
                        <a class="update" title="Update" href="/strukturOrganisasi/update/<?php echo $key?>">
                            <img src="/images/icon/update.png" alt="Update" />
                        </a> 
                        <a class="delete" onClick="if(!confirm('Are you sure you want to delete this item?')) return false;" title="Delete" href="/strukturOrganisasi/delete/<?php echo $key?>">
                            <img src="/images/icon/delete.png" alt="Delete" />
                        </a>
                    </td>
                </tr>
                <?php
                    }
                ?>
             </tbody>
        </table>
    </div>
    
</div>